/*********************************************************************************
 *      Copyright:  (C) 2017 luminqi
 *                  All rights reserved.
 *
 *       Filename:  str_main.c
 *    Description:  This file 
 *                 
 *        Version:  1.0.0(2017年08月24日)
 *         Author:  luminqi <958822582@qq.com>
 *      ChangeLog:  1, Release initial version on "2017年08月24日 14时09分50秒"
 *                 
 ********************************************************************************/

#include "str.h"

int main(int argc, char **argv)
{
    char *str1 = (char *)malloc(40);
    char *str2 = (char *)malloc(20);
    char *dest = NULL;
    int res = 0;
    int len = 0;

    if ((str1==NULL)||(str2==NULL))
    {
        return -1;
    }

    printf("please input str1 and str2:\n");
    scanf("%s%s",str1,str2);

    printf("str1 = %s\n",str1);
    printf("str2 = %s\n",str2);

    len = str_len(str1);
    printf("length of str1 = %u\n",len);
    len = str_len(str2);
    printf("length of str2 = %u\n",len);

    

    /*dest = str_copy(str1, str2);
    printf("after copy:\n");
    printf(dest);
    printf("\n");*/
    
    /*dest = str_cat(str1, str2);
    printf("after connect:\n");
    printf(dest);
    printf("\n");*/

    res = str_cmp(str1, str2);
    if(res)
    {
        printf("不相等");
    }
    else
    {
        printf("相等");
    }

    free(str1);
    free(str2);
    str1 = NULL;
    str2 = NULL;
    return(0);
}
